Various techniques have been suggested for measuring, without contact, a depth of a three-dimensional scene, that is, a distance to each subject. Such techniques can be largely classified into an active technique and passive technique. In the active technique, the subject is irradiated with infrared rays, ultrasound, or laser, so as to calculate a distance based on a length of time until a reflected wave returns or an angle of the reflected wave. In the passive technique, the distance is calculated based on an image of the subject. Particularly, in the case of using a camera to measure the distance to the subject, the passive technique which does not require an apparatus for emitting infrared rays and so on is widely used.
Various passive techniques have been suggested, one of which is referred to as Depth from defocus (hereinafter, referring to as “DFD”) which is a technique to measure the distance based on a blur generated by focus (focal position) change. The DFD has features such as not requiring a plurality of cameras, allowing distance measurement using a small number of images, and so on.
The DFD is a distance measurement technique using a blur of an image. However, there is a problem that it is extremely difficult to determine, from the captured image alone, whether the blur in the captured image was caused by change in lens focus or whether an original image which represents a state without lens-derived blur has a blurred texture from the beginning.
To deal with this, Patent Literature 1 discloses a distance measurement method independent from a spectral component of the original image, in which a ratio of a spatial frequency spectrum in each of a plurality of captured images is compared with a ratio of the spatial frequency spectrum of the blur corresponding to the depth of the scene.
On the other hand, Patent Literature 2 discloses a technique to obtain a reference image corresponding to the original image by capturing a large number of images by changing focus and extracting only focused portions of the images. The distance is measured by configuring a scale space in which various blurs are convolved into this reference image, and comparing the reference image and captured image on the scale space.